package com.yale.elasticsearch.controller.query;

import com.yale.elasticsearch.dto.WildcardQueryDTO;
import com.yale.elasticsearch.service.query.WildcardQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author :yale
 * @date : 2024/8/1
 */
@Api(tags = "查询-通配符查询")
@RestController
@RequestMapping("/query")
public class WildcardQueryController {

    @Resource
    private WildcardQueryService wildcardQueryService;

    @ApiOperation(value = "通配符查询", notes = "通配符查询")
    @PostMapping("/wildcard")
    public Object wildcardQuery(@Valid @RequestBody WildcardQueryDTO wildcardQueryDTO) {
        return wildcardQueryService.wildcardQuery(wildcardQueryDTO);
    }

}